package com.loren.demo07.cluster.utils;

import org.apache.commons.lang3.StringUtils;

public class QueryUtils {
    public static String getParameter(String query, String parameter) {
        String[] splits = StringUtils.split(query, "&");
        for (String split : splits) {
            String[] maps = StringUtils.split(split, "=");
            if (maps.length == 2) {
                if (StringUtils.equalsIgnoreCase(maps[0], parameter)) {
                    return maps[1];
                }
            }
        }
        return null;
    }
}
